﻿using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace CalcSharp.forms
{
    public partial class xmlmenudesigner : Form
    {
        public xmlmenudesigner()
        {
            InitializeComponent();
        }

        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {

        }

        private void deToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult r;
            if (menuTree.SelectedNode != null)
            {
                if (menuTree.SelectedNode.Nodes.Count > 0) r = MessageBox.Show("If you delete this menu item the submenus will also be deleted. Continue ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
                else r = DialogResult.Yes;
                if ( r == DialogResult.Yes) menuTree.SelectedNode.Remove();
            }
        }
    }
}